WPF and Silverlight Edition Basic Library > Combo Box > ComboBox Features > Drop-Down List > Setting the Maximum Height and Width |
By default, the size of the drop-down list is determined by the width of the widest C1ComboBoxItem item and the collective height of all of the C1ComboBoxItem items, as the DropDownWidth and DropDownHeight properties are both set to NaN.
You can control the maximum width and maximum height of the drop-down list by setting the C1ComboBox control's MaxDropDownWidth and MaxDropDownHeight properties. Setting these properties ensures that the area of the drop-down list can never expand to a larger area than you've specified. If the width or height of the list exceeds the specified maximum height and width, scrollbars will automatically be added to the drop-down list.
Complete the following steps:
XAML Copy Code <c1:C1ComboBox HorizontalAlignment="Left" Width="249" MaxDropDownHeight="150" MaxDropDownWidth="350">.
Complete the following steps:
Visual Basic Copy Code C1ComboBox1.MaxDropDownHeight = 150
C# Copy Code C1ComboBox1.MaxDropDownHeight = 150;
Visual Basic Copy Code C1ComboBox1.MaxDropDownWidth = 350
C# Copy Code C1ComboBox1.MaxDropDownWidth = 350;
Complete the following steps: